Migrating virtual machines

ABSTRACT

There is provided system for migrating virtual machines. The system is capable of managing virtual machines in a source service for hosting one or more source virtual machines and a destination service for hosting one or more destination virtual machines, and memory for storing program code and at least one processing core capable of executing the program code to cause generating, by the source service, a temporary virtual machine in the source service, attaching, by the source service, at least one storage drive of at least one source virtual machine, to the temporary virtual machine, preparing, by the temporary virtual machine, a disk image of the attached at least one storage drive in a format supported by the destination service, and writing, by the temporary virtual machine, the disk image to a storage drive of the destination virtual machine.

FIELD

The present disclosure relates to migrating virtual machines between asource service and a destination service for hosting virtual machines.

BACKGROUND

Migration of virtual machine usually takes two to five hours. Tools maybe installed to the virtual machine for making the migration faster.When more than one virtual machine is migrated, for example more thanten or a hundred, installing tools to the virtual machines to bemigrated becomes a time consuming task. Moreover, the migration toolscause load to the virtual machine.

US 2016/0004467 A1 discloses technology by which a virtual hard disk ismigrated from a source storage location to a target storage locationwithout needing any shared physical storage, in which a machine maycontinue to use the virtual hard disk during migration. This facilitatesuse the virtual hard disk in conjunction with live-migrating a virtualmachine. Virtual hard disk migration may occur fully before or after thevirtual machine is migrated to the target host, or partially before andpartially after virtual machine migration. Internal migration agents insource and target virtual machines communicate to handle the migrationof data.

SUMMARY OF THE INVENTION

The invention is defined by the features of the independent claims. Somespecific embodiments are defined in the dependent claims.

According to a first aspect of the present invention, there is provideda system for migrating virtual machines and capable of managing virtualmachines in a source service for hosting one or more source virtualmachines and a destination service for hosting one or more destinationvirtual machines, and memory for storing program code and at least oneprocessing core capable of executing the program code to cause:generating, by the source service, a temporary virtual machine in thesource service; attaching, by the source service, at least one storagedrive of at least one source virtual machine, to the temporary virtualmachine; preparing, by the temporary virtual machine, a disk image ofthe attached at least one storage drive in a format supported by thedestination service; and writing, by the temporary virtual machine, thedisk image to a storage drive of the destination virtual machine.

According to a second aspect of the present invention, there is provideda method for migrating virtual machines, comprising: managing virtualmachines in a source service for hosting one or more source virtualmachines and a destination service for hosting one or more destinationvirtual machines; generating, by the source service, a temporary virtualmachine in the source service; attaching, by the source service, atleast one storage drive of at least one source virtual machine, to thetemporary virtual machine; preparing, by the temporary virtual machine,a disk image of the attached at least one storage drive in a formatsupported by the destination service; and writing, by the temporaryvirtual machine, the disk image to a storage drive of the destinationvirtual machine.

According to a third aspect of the present invention, there is provideda computer program configured to cause a method in accordance with amethod the second aspect of the present invention.

Various embodiments of the first, second and third aspects may compriseat least one feature from the following bulleted list:

-   -   a web-based user interface comprising at least one user        interface element and selecting the user interface element cause        selecting the destination service    -   the web-based user interface comprises one or more user        interface elements that in response to selection of user cause        selecting source virtual machines to be migrated to a specific        destination service or to determine a destination service on the        basis of parameters for example geographical location, an amount        of virtual machine resources, cost, migration time and/or        migration date    -   one or more user interface elements for source virtual machine        selection, wherein selecting the user interface element for        source virtual machine selection causes filtering virtual        machines of the source hosting service for migrating a group of        virtual machines to the destination hosting service    -   the migration is performed at a time of low load of the source        virtual machine    -   virtual machine parameters for the source service and/or        destination service are determined on the basis of user account        information for the source and destination services    -   the at least one storage drive of the source service is        converted to a virtual hard drive file format of the destination        service    -   after migrating the virtual machine to the destination service,        one or more of the following is performed:        -   the at least one storage drive of the source service is            detached from the temporary virtual machine;        -   the at least one source virtual machine and the at least one            storage drive are deleted; and/or        -   the at least one storage drive is attached back to source            virtual machine    -   a notification indicating status of the migration is displayed        or otherwise communicated to a user.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates example architecture for a system in accordance withat least some embodiments of the present invention;

FIG. 2 is a flow graph of method in accordance with at least someembodiments of the present invention; and

FIG. 3 is a sequence in accordance with at least some embodiments of thepresent invention.

EMBODIMENTS

In connection with migrating virtual machines from a source service to adestination service a temporary virtual machine is generated in thesource service. At least one storage drive of at least one sourcevirtual machine is attached to the temporary virtual machine. Thetemporary virtual machine prepares a disk image of the attached at leastone storage drive in a format supported by the destination service. Thedisk image is written to a storage drive of the destination virtualmachine. In this way computational load to the source virtual machinemay be kept low.

FIG. 1 illustrates example architecture for a system in accordance withat least some embodiments of the present invention. The system maycomprise at least two hosting services 102, 112 for virtual machines104, 114. A hosting service may be a cloud, i.e. an internet-basedcomputing service that provides shared computing resources and datastorage to computers and other devices connected to internet. In cloud,the computing resources and data storage may be provided in third-partydata centers that may be located geographically far from the user.

The hosting services may comprise application programming interfaces122, 124 (APIs) via which the virtual machines may be managed by usersof the hosting services. Examples of services provided by the APIscomprise generating virtual machines, generating storage drives invirtual machines, allocating processing resources to virtual machinesand managing user information, attaching storage devices, detachingstorage devices, data transfer to storage devices, for example.

A Virtual Machine (VM) provides a substitute for a real computer machineon hardware shared between many virtual machines managed by a hypervisorin the hosting service 102, 112. The virtual machine may have one ormore storage drives for storing data, operating system and applications.The storage drives of VMs may be referred to as virtual hard drives(VHDs). VHDs allow multiple operating systems to reside on a singlehosting machine and without partitioning a single hard disk intomultiple drives. VHDs may be implemented as files in a VHD file formaton a native file system. VHD files may be identified from the filenameextension “.vhd”. Examples of the VHD file format include a fixed VHDand a dynamic VHD supported by Microsoft Virtual PC and Virtual Server.

It should be appreciated that the hosting services may be different. Thedifferences may be reflected in the VMs hosted by the hosting services,VHD file formats, the APIs and/or in user interfaces of the hostingservices.

The hosting service 102, 112 may comprise a user database 106, 116 forstoring information of users of the hosting service. The information inthe user database may facilitate authentication of the users andinvoicing users of the hosting services, for example.

A migration controller 126 may be connected to the hosting services overinternet connections. The migration controller may be capable of causingto migrate virtual machines from one hosting service to another. Thehosting service including the VM that is to be migrated may be referredto a source hosting service 102 and the virtual machine to be migratedmay be referred to a source virtual machine 104. The hosting service,where the source VM is migrated may be referred to a destination hostingservice 112 and a virtual machine in the destination hosting service maybe referred to a destination virtual machine 114. The migrationcontroller may be a computer or a virtual machine hosted by the sourceor destination hosting service or any other hosting service. Preferably,the migration controller is capable of providing a user interface to theuser.

In migration of virtual machine (VM_S) from the source hosting serviceto the destination hosting service, a new virtual machine, thedestination virtual machine (VM_D) is generated in the destinationhosting service, data of the source virtual machine is copied to thedestination virtual machine and the destination virtual machine takesover the tasks performed by the source virtual machine.

FIG. 2 is a flow graph of method in accordance with at least someembodiments of the present invention. The phases of the illustratedmethod may be caused directly or indirectly by an entity capable ofgenerating one or more virtual machines in a source hosting service. Theentity may be a migration controller in FIG. 1, capable of managingvirtual machines in a source service for hosting one or more sourcevirtual machines and a destination service for hosting one or moredestination virtual machines, for example. The phases provide migratingvirtual machines between the source hosting service and the destinationhosting service.

Phase 202 comprises generating, by the source service, a temporaryvirtual machine in the source service. Phase 204 comprises attaching, bythe source service, at least one storage drive of at least one sourcevirtual machine, to the temporary virtual machine. Phase 206 comprisespreparing, by the temporary virtual machine, a disk image of theattached at least one storage drive in a format supported by thedestination hosting service. Phase 208 comprises writing, by thetemporary virtual machine, the disk image to a storage drive of thedestination virtual machine. In this way computational load to thesource virtual machine may be kept low, when the source virtual machineis migrated to the destination hosting service.

It should be appreciated that information of the hosting services suchas VHD file format used in the destination hosting service and/orconfiguration information of VMs may be available to the migrationcontroller, or other entity, capable of managing virtual machines in thesource hosting service and the destination hosting service. In anexample the configuration information of VMs may comprise configurationtemplates for VMs. A configuration template may define properties of theVM for example by one or more of the following: a number of processingcores, processors, memory and storage drive size.

FIG. 3 is a sequence in accordance with at least some embodiments of thepresent invention. The sequence includes functionalities performed bythe source hosting service 102, the destination hosting service 112 andthe migration controller 126 illustrated in FIG. 1. The functionalitiesmay involve the entities that underlie the phases of FIG. 3.

Initially a user may have obtained a user account to both the sourcehosting service and the destination hosting service. In 302, themigration controller may authenticate the user to the hosting services.The authentication enables the migration controller to obtaininformation of the hosting services and virtual machines hosted by thehosting services. In this way virtual machine parameters for the sourcehosting service and/or destination hosting service may be determined onthe basis of the user account information for the source and destinationhosting services.

In an example information obtained from the hosting service may comprisesize of compute units, memory blocks, virtual hard drive file format andvirtual machine locations. In migration of a source virtual machine to adestination virtual machine, the parameters of the destination virtualmachine may be determined to at least sufficiently match the parametersof the source virtual machine.

In one example of utilizing the user account information for the sourceand destination hosting services, the user may be authenticated to bothhosting services by the migration controller since the user hascredentials to both of the hosting services. Credentials of the user maybe stored to the migration controller such that the migration controllermay authenticate the user with the hosting services. The information ofthe hosting services may comprise VHD file format used in thedestination hosting service and/or configuration information of VMs. Theconfiguration information of VMs may comprise configuration templatesfor VMs. A configuration template may define properties of the VM forexample by one or more of the following: a number of processing cores,processors, memory and storage drive size.

In 304, one or more VMs of the source hosting service may be selected bythe migration controller to be migrated to a destination hostingservice. Available hosting services for serving as the destinationhosting service may be determined on the basis of user accountinformation. Accordingly, the available destination hosting services maycomprise all the hosting services that the user has an account to.

In 306, the destination hosting service may be selected by the migrationcontroller. The migration controller may provide a user interface viawhich the user may select the destination hosting service. The userinterface may comprise user interface elements that may be selectable tothe user for selecting the destination hosting service. The userinterface elements may provide explicit selection of the destinationhosting service, for example selecting the name of the destinationhosting service. On the other hand the destination hosting service maybe determined on the basis of parameters that may be selectable to theuser via corresponding user interface elements. Examples of theparameters comprise a geographical location, an amount of virtualmachine resources, cost, migration time and/or migration date. Thedestination hosting service may be selected from available destinationhosting services determined on the basis of the parameters selected bythe user. Examples of user interface comprise graphical user interfaces,where information such as text, graphics and video may be displayed tousers in user interface elements. User interface elements may comprisedrop-down menus and check boxes, for example. The user interface may beprovided as a standalone application on the migration controller or theuser interface may be a web-based user interface provided on an internetbrowser communicating with a server hosting the web-based userinterface.

In an embodiment a web-based user interface is provided to a user. Theweb-based user interface may allow selecting 304 VMs of the sourcehosting service and/or selecting a destination hosting service. Theweb-based user interface may comprise at least one user interfaceelement for destination hosting service selection (DHSS), and selectingthe user interface element for DHSS may cause selecting 306 adestination hosting service for migrating the selected VM of the sourcehosting service. Alternatively or additionally, the web-based userinterface may comprise one or more user interface elements for source VMselection (SVMS), and selecting the user interface element for SVMS maycause filtering VMs of the source hosting service. In this way a groupof VMs of the source hosting service may be selected for migration tothe destination hosting service. Filtering the VMs of the source hostingservice may be particularly useful, when the number of VMs is large inthe source hosting service. The VMs resulting from the filtering may beselected for migrating the selected VM of the source hosting service byuser interface element for DHSS provided on the web-based userinterface. It should be appreciated that when a group of VMs is selectedfor migration, migration of single VMs belonging to the group may beperformed as described in various embodiments herein. In an embodiment,the destination hosting service may be selected 306 on a web-based userinterface that comprises one or more user interface elements that inresponse to selection of the user cause selecting the source virtualmachine to be migrated to a specific destination hosting service or todetermine a destination hosting service on the basis of parameters forexample geographical location, an amount of virtual machine resources,cost, migration time and/or migration date.

In an example of selecting 306 the destination hosting service on aweb-based user interface, selecting user interface elements may causefiltering available destination hosting services on the basis ofparameters selected by the user. The user may then select thedestination hosting service from the filtered destination hostingservices.

In 308, a temporary virtual machine (Temp VM) may be generated by themigration controller in the source hosting service similar to phase 202in FIG. 2.

In 310 the source VM may be suspended or stopped by the migrationcontroller. In this way the migration may be performed safely withoutcorruption of data. In 314, a storage drive of the source virtualmachine is attached to the temporary virtual machine by the migrationcontroller similar to phase 204 in FIG. 2. It should be appreciated thatthe storage drive attached to the temporary virtual machine may bedetached 312 by the migration controller prior to attaching 314 thestorage drive to the temporary virtual machine.

In 316, a migration program may be installed to the temporary virtualmachine by the migration controller. In this way the temporary virtualmachine may be allocated tasks in migrating the source virtual machineto the destination virtual machine. The migration program may begenerated by the migration controller on the basis of the obtained 302information of the hosting services. The migration program may beconfigured to be executed at a specific migration time that is set onthe basis of parameter selections obtained from the user.

In an example of generating the migration program, the migration programmay be selected from a group of pre-generated migration programs on thebasis of the obtained 302 information of the hosting services. Migrationprograms in the group of migration programs may be defined for migratingvirtual machines having different virtual hard drive file formats.Accordingly, migration programs may be pre-defined for differentcombinations for source and destination hosting services which may usedifferent virtual hard drive file formats.

In 317 a start time for migration tasks may be determined by thetemporary virtual machine. Preferably the start time is determined to bethe time, when the load of the source virtual machine is low. The timeof low load may be for example night time. In one example the temporaryvirtual machine may determine the migration time and/or migration dateon the basis of parameter selections of the user regarding. Theseselections may be obtained from the migration program. In one examplethe temporary virtual machine may determine the start time on the basisof monitoring load of the source virtual machine.

It should be appreciated that the migration time configured in themigration program or the migration time determined by monitoring theload of the source virtual machine may be used as the migration time.Moreover, prioritization may be applied to the migration times such thateither the migration time determined by monitoring the load or themigration time configured in the migration program may be chosen to beapplied if both are defined.

In 318, a disk image of the storage drive attached to the temporaryvirtual machine may be prepared by the temporary virtual machine. Thedisk image may be prepared similar to phase 206 in FIG. 2. The diskimage may be prepared by utilizing the information of the hostingservices obtained similar to described in 302. On the other hand thedisk image may be prepared on the basis of information that ispreconfigured in the migration program. In an example the source hostingservice and the destination hosting service may have different virtualstorage drive file formats. Accordingly, preparing the disk image maycomprise converting the storage device into a raw image format. The rawimage format may be converted to the virtual storage drive file formatsupported by the destination hosting service.

In 320 the prepared disk image may be written to a storage drive of thenew virtual machine by the temporary virtual machine, similar asdescribed in phase 208 in FIG. 2.

In 322 the new VM may be generated in the destination hosting service bythe temporary virtual machine. The storage drive written in 320 may beattached to the new VM.

After the disk image has been written to the storage drive and thestorage drive is attached to the new VM, the new VM in the destinationhosting service may substitute the source VM in the source hostingservice and the temporary virtual machine may notify 324 the migrationcontroller that the source VM has been migrated. The notification mayindicate status of the migration and be displayed or otherwisecommunicated to the user.

In 326, after the migration controller obtains information from thetemporary virtual machine indicating that the source VM has beenmigrated, the migration controller may consider the migration complete.However, in an embodiment additionally one or more of the following isperformed by the migration controller: the at least one storage drive ofthe source service is detached from the temporary virtual machine, theat least one source virtual machine and the at least one storage driveare deleted, and/or the at least one storage drive is attached back tosource virtual machine. At least some of the above tasks performed afterthe source VM has been migrated provide that resources such as virtualmachines and/or storage drives may be released. If the storage drive isattached back to the source VM, the source VM may be preserved for lateruse.

An embodiment may involve a migration program. The migration program maybe a computer program. The migration program may comprise computer codeor instructions. The migration program may be executed on a computer orvirtual machine to cause one or more functionalities described in anembodiment.

An embodiment comprises a computer program configured to causefunctionalities of a method or sequence according to an embodiment.

According to an embodiment there is provided a non-transitory computerreadable medium having stored thereon a set of computer readableinstructions that, when executed by at least one processor, cause tocause functionalities of a method or sequence according to anembodiment.

It is to be understood that the embodiments of the invention disclosedare not limited to the particular structures, process steps, ormaterials disclosed herein, but are extended to equivalents thereof aswould be recognized by those ordinarily skilled in the relevant arts. Itshould also be understood that terminology employed herein is used forthe purpose of describing particular embodiments only and is notintended to be limiting.

Reference throughout this specification to one embodiment or anembodiment means that a particular feature, structure, or characteristicdescribed in connection with the embodiment is included in at least oneembodiment of the present invention. Thus, appearances of the phrases“in one embodiment” or “in an embodiment” in various places throughoutthis specification are not necessarily all referring to the sameembodiment. Where reference is made to a numerical value using a termsuch as, for example, about or substantially, the exact numerical valueis also disclosed.

As used herein, a plurality of items, structural elements, compositionalelements, and/or materials may be presented in a common list forconvenience. However, these lists should be construed as though eachmember of the list is individually identified as a separate and uniquemember. Thus, no individual member of such list should be construed as ade facto equivalent of any other member of the same list solely based ontheir presentation in a common group without indications to thecontrary. In addition, various embodiments and example of the presentinvention may be referred to herein along with alternatives for thevarious components thereof. It is understood that such embodiments,examples, and alternatives are not to be construed as de factoequivalents of one another, but are to be considered as separate andautonomous representations of the present invention.

Furthermore, the described features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments. In thepreceding description, numerous specific details are provided to providea thorough understanding of embodiments of the invention. One skilled inthe relevant art will recognize, however, that the invention can bepracticed without one or more of the specific details, or with othermethods, components, materials, etc. In other instances, well-knownstructures or operations are not shown or described in detail to avoidobscuring aspects of the invention.

While the forgoing examples are illustrative of the principles of thepresent invention in one or more particular applications, it will beapparent to those of ordinary skill in the art that numerousmodifications in form, usage and details of implementation can be madewithout the exercise of inventive faculty, and without departing fromthe principles and concepts of the invention. Accordingly, it is notintended that the invention be limited, except as by the claims setforth below.

The verbs “to comprise” and “to include” are used in this document asopen limitations that neither exclude nor require the existence of alsoun-recited features. The features recited in depending claims aremutually freely combinable unless otherwise explicitly stated.Furthermore, it is to be understood that the use of “a” or “an”, thatis, a singular form, throughout this document does not exclude aplurality.

ACRONYMS LIST

-   API Application programming interface-   DHSS Destination hosting service selection-   VHD Virtual hard drive-   VM Virtual machine-   VM_D Destination virtual machine-   VM_S Source virtual machine-   SVMS Source VM selection-   Temp VM Temporary virtual machine

REFERENCE SIGNS LIST 102, 112 Hosting services for hosting virtualmachines 104 Virtual machine of source hosting service 106, 116 Userdatabase of hosting service 122, 124 Application programming interfaceof hosting service 126 Migration controller 202-208 Phases of the methodof FIG. 2 302-326 Phases of the sequence of FIG. 3

1. A system for migrating virtual machines and capable of managingvirtual machines in a source service for hosting source virtual machinesand a destination service for hosting destination virtual machines,wherein the source virtual machines of the source service are migratedto destination virtual machines in the destination service such that thevirtual machines of the source service are substituted with thedestination virtual machines, wherein the system comprises a web-baseduser interface and memory for storing program code and at least oneprocessing core capable of executing the program code to cause:filtering, in response to a first selection of the user on the web-baseduser interface, virtual machines of the source service for migrating agroup of virtual machines from a source service to a destinationservice; and determining, in response to a second selection of the useron the web-based user interface, the destination service from availabledestination services on the basis of user account information andcausing: a. generating, by the source service, temporary virtualmachines for the group of virtual machines in the source service; b.attaching, by the source service, storage drives of the group of virtualmachines, to the temporary virtual machines; c. preparing, by thetemporary virtual machines, disk images of the attached storage drivesin a format supported by the determined destination service; and d.writing, by the temporary virtual machines, the disk images to storagedrives of the destination virtual machines of the determined destinationservice.
 2. The system according to claim 1, wherein the web-based userinterface comprises one or more user interface elements that in responseto selection of user cause selecting source virtual machines to bemigrated to a specific destination service or to determine a destinationservice on the basis of parameters for example geographical location, anamount of virtual machine resources, cost, migration time and/ormigration date.
 3. The system according to claim 1, wherein themigration is performed at a time of low load of the source virtualmachine.
 4. The system according to claim 1, wherein virtual machineparameters for the source service and/or destination service aredetermined on the basis of user account information for the source anddestination services.
 5. The system according to claim 1, wherein the atleast one storage drive of the source service is converted to a virtualhard drive file format of the destination service.
 6. The systemaccording to claim 1, wherein after migrating the virtual machine to thedestination service, one or more of the following is performed: the atleast one storage drive of the source service is detached from thetemporary virtual machine; the at least one source virtual machine andthe at least one storage drive are deleted; and/or the at least onestorage drive is attached back to source virtual machine.
 7. The systemaccording to claim 1, wherein a notification indicating status of themigration is displayed or otherwise communicated to a user.
 8. Thesystem according to claim 1, wherein a destination virtual machine takesover the tasks performed by a source virtual machine.
 9. A method formigrating virtual machines, comprising: managing virtual machines in asource service for hosting source virtual machines and a destinationservice for hosting destination virtual machines; migrating the sourcevirtual machines of the source service to destination virtual machinesin the destination service such that the virtual machines of the sourceservice are substituted with the destination virtual machines;filtering, in response to a first selection of the user on a web-baseduser interface, virtual machines of the source service for migrating agroup of virtual machines to a destination service; and determining, inresponse to a second selection of the user on the web-based userinterface, the destination service from available destination serviceson the basis of user account information and causing: a. generating, bythe source service, temporary virtual machines for the group of virtualmachines in the source service; b. attaching, by the source service,storage drives of the group of virtual machines, to the temporaryvirtual machines; c. preparing, by the temporary virtual machines, diskimages of the attached storage drives in a format supported by thedetermined destination service; and d. writing, by the temporary virtualmachines, the disk images to storage drives of the destination virtualmachines of the determined destination service.
 10. A computer programproduct comprising program code stored on a non-transitory computerreadable medium, wherein the program code is arranged to perform amethod for migrating virtual machines when the computer program productis executed on a computer, the method comprising: managing virtualmachines in a source service for hosting source virtual machines and adestination service for hosting destination virtual machines; migratingthe source virtual machines of the source service to destination virtualmachines in the destination service such that the virtual machines ofthe source service are substituted with the destination virtualmachines; filtering, in response to a first selection of the user on aweb-based user interface, virtual machines of the source service formigrating a group of virtual machines to a destination service; anddetermining, in response to a second selection of the user on theweb-based user interface the destination service from availabledestination services on the basis of user account information andcausing: a. generating, by the source service, temporary virtualmachines for the group of virtual machines in the source service; b.attaching, by the source service, storage drives of the group of virtualmachines, to the temporary virtual machines; c. preparing, by thetemporary virtual machines, disk images of the attached storage drivesin a format supported by the determined destination service; and d.writing, by the temporary virtual machines, the disk images to storagedrives of the destination virtual machines of the determined destinationservice.